/*
 *@description:订单页面
 *@Author:@rennan
 *@Date:2023-12-26 16:56:39
 *@version: V1.0.0
*/
<template>
  <div class="order_box">
    <van-nav-bar title="订单" />

    <van-tabs v-model="active" color="rgb(191, 115, 255)" title-active-color="rgb(191, 115, 255)">
      <van-tab title="全部订单">
        <OrderItem v-for="item in orderList" :key="item.id" :orderItem="item" />
      </van-tab>
      <van-tab title="待支付">内容 2</van-tab>
      <van-tab title="待派单">内容 3</van-tab>
      <van-tab title="已完成">内容 4</van-tab>
    </van-tabs>
  </div>
</template>
<script>
import OrderItem from "@/components/OrderItem/index.vue"
import instance from "@/utils/instance";
export default {
  data() {
    return {
      active:0,
      orderList:[]
    }
  },
  methods:{
    // 获取全部订单
    getAllOrder(){
      instance.get('/order/pageQuery?page=1&pageSize=100').then(res=>{
        this.orderList = res.data.data.list
        
        console.log(this.orderList);
      })
    }
  },
  components:{
    OrderItem
  },
  created(){
    this.getAllOrder()
  }
}
</script>
<style scoped>
.van-tab--active{
  background-color: #9002bf;
}
</style>